import { CloudRequest } from '../utils/cloud-request.js'
class LoginModel extends CloudRequest {
  
  /**
   * 查询用户是否存在
   * @param {*} user_type 
   * @param {*} callBack 
   */
  addUser(user_type,callBack){
    this.request({
        url: "addUser",
        data:user_type,
        success: res => {
          callBack(res)
        }
    })
  }
  
  /**
   * 用户登录 
   * @param {*} callBack 
   */
  getUser(user_type,callBack){
    this.request({
        url: "getUser",
        data:user_type,
        success: res => {
          callBack(res)
        }
    })
  }

  /**
   * 获取最新商品
   * @param {*} callBack 
   */
  getProductNew(callBack){
    this.request({
      url: "getProductNew",
      success: res => {
        callBack(res)
      }
    })
  }

}

export { LoginModel }